package com.example.agricultural_big_data.service.serviceimpl;

import com.example.agricultural_big_data.mapper.AdverseMapper;
import com.example.agricultural_big_data.pojo.Adverse;
import com.example.agricultural_big_data.service.AdverseService;
import com.example.agricultural_big_data.util.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:AdverseImpl
 * Package:com.example.agricultural_big_data.service.serviceimpl
 * Description:
 *
 * @Data:2022/5/17 1:36
 */
@Service
public class AdverseImpl implements AdverseService {

    @Autowired
    AdverseMapper adverseMapper;
    @Override
    public int addAdverse(Adverse adverse) {
        adverse.setAdverseId(UUIDUtil.randomUUID());
        adverse.setAdverseStatus("0");
        return adverseMapper.addAdverse(adverse);
    }

    @Override
    public List<Adverse> getListByUserId(String userId) {
        return adverseMapper.getListByUserId(userId);
    }
}
